<%@ tag language="java" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ attribute name="permissionPrefix" type="java.lang.String" required="true" description="shiro权限前缀"%>	
<%@ attribute name="enableShiro" type="java.lang.String" required="false" description="是否根据权限声明生成按钮,传入false则生成全部按钮"%>
<c:choose>
	<c:when test="${enableShiro=='false'}">
<script type="text/javascript">
	function displayButtons(cellvalue, options, rowObject)
	{
		var result="";
		result += "<div title=\"\" style=\"float:left;cursor:pointer;\" class=\"ui-pg-div ui-inline-edit\" id=\"jEditButton_1\""
			+ " onclick=\"editAction(baseActionUrl+'/edit','"+options.rowId +"')\"" 
			+ " onmouseover=\"jQuery(this).addClass('ui-state-hover');\" onmouseout=\"jQuery(this).removeClass('ui-state-hover')\" data-original-title=\"编辑所选记录\">" + "<span class=\"ui-icon ui-icon-pencil\"></span></div>"; 
		result += "<div title=\"\" style=\"float:left;margin-left:5px;\" class=\"ui-pg-div ui-inline-del\" id=\"jDeleteButton_1\""
			+ " onclick=\"deleteAction(baseActionUrl+'/delete','"+options.rowId +"')\"" 
			+" onmouseover=\"jQuery(this).addClass('ui-state-hover');\" onmouseout=\"jQuery(this).removeClass('ui-state-hover');\" data-original-title=\"删除所选记录\">" + "<span class=\"ui-icon ui-icon-trash\"></span></div>"; 
	    return result;
	}
</script>
<div style="padding-bottom:3px;">
	&nbsp;<button class="btn btn-success" id="btnView" data-rel="tooltip" title="查看所选记录"><i class="fa fa-search-plus"></i> 查看</button>
	&nbsp;<button class="btn btn-warning" id="btnAdd" data-rel="tooltip" title="添加新记录"><i class="fa fa-plus-circle"></i> 增加</button>
	&nbsp;<button class="btn btn-primary" id="btnEdit" data-rel="tooltip" title="编辑所选记录"><i class="fa fa-pencil s"></i> 编辑</button>
	&nbsp;<button class="btn btn-danger" id="btnBatchDel" data-rel="tooltip" title="删除所选记录"><i class="fa fa-trash-o"></i> 删除</button>	
	&nbsp;<button class="btn btn-primary" id="btnExportExcel" data-rel="tooltip" title="导出Excel"><i class="fa fa-cloud-download"></i> 导出Excel</button>	
	&nbsp;<button class="btn btn-primary" id="btImportExcel" data-rel="tooltip" title="数据导入"><i class="fa fa-cloud-upload"></i> 数据导入</button>	
</div>	
	</c:when>
	<c:otherwise>
<script type="text/javascript">
	function displayButtons(cellvalue, options, rowObject)
	{
		var result="";
		<shiro:hasPermission name="${permissionPrefix}:edit">
		result += "<div title=\"\" style=\"float:left;cursor:pointer;\" class=\"ui-pg-div ui-inline-edit\" id=\"jEditButton_1\""
			+ " onclick=\"editAction(baseActionUrl+'/edit','"+options.rowId +"')\"" 
			+ " onmouseover=\"jQuery(this).addClass('ui-state-hover');\" onmouseout=\"jQuery(this).removeClass('ui-state-hover')\" data-original-title=\"编辑所选记录\">" + "<span class=\"ui-icon ui-icon-pencil\"></span></div>"; 
		</shiro:hasPermission>
		<shiro:hasPermission name="${permissionPrefix}:delete">
		result += "<div title=\"\" style=\"float:left;margin-left:5px;\" class=\"ui-pg-div ui-inline-del\" id=\"jDeleteButton_1\""
			+ " onclick=\"deleteAction(baseActionUrl+'/delete','"+options.rowId +"')\"" 
			+" onmouseover=\"jQuery(this).addClass('ui-state-hover');\" onmouseout=\"jQuery(this).removeClass('ui-state-hover');\" data-original-title=\"删除所选记录\">" + "<span class=\"ui-icon ui-icon-trash\"></span></div>"; 
		</shiro:hasPermission>
	    return result;
	}
</script>
<div style="padding-bottom:3px;">
	<shiro:hasPermission name="${permissionPrefix}:view">
	&nbsp;<button class="btn btn-success" id="btnView" data-rel="tooltip" title="查看所选记录"><i class="fa fa-search-plus"></i> 查看</button>
	</shiro:hasPermission>
	<shiro:hasPermission name="${permissionPrefix}:add">
	&nbsp;<button class="btn btn-warning" id="btnAdd" data-rel="tooltip" title="添加新记录"><i class="fa fa-plus-circle"></i> 增加</button>
	</shiro:hasPermission>
	<shiro:hasPermission name="${permissionPrefix}:edit">
	&nbsp;<button class="btn btn-primary" id="btnEdit" data-rel="tooltip" title="编辑所选记录"><i class="fa fa-pencil s"></i> 编辑</button>
	</shiro:hasPermission>
	<shiro:hasPermission name="${permissionPrefix}:delete">
	&nbsp;<button class="btn btn-danger" id="btnBatchDel" data-rel="tooltip" title="删除所选记录"><i class="fa fa-trash-o"></i> 删除</button>	
	</shiro:hasPermission>
	<shiro:hasPermission name="${permissionPrefix}:view">
	&nbsp;<button class="btn btn-primary" id="btnExportExcel" data-rel="tooltip" title="导出Excel"><i class="fa fa-cloud-download"></i> 导出Excel</button>	
	</shiro:hasPermission>
	<shiro:hasPermission name="${permissionPrefix}:edit">
	&nbsp;<button class="btn btn-primary" id="btImportExcel" data-rel="tooltip" title="数据导入"><i class="fa fa-cloud-upload"></i> 数据导入</button>	
	</shiro:hasPermission>
</div>	
	</c:otherwise>
</c:choose>
